(function (G) {
    const javaUrl = G.Storage.get('JAVAURL')
    G.vue({
        data: {
            listArr:[],
            keyWord:'',
            listArrSaveData:[],//保存的数据,用于搜索
        },
        methods: {
          getList (){
            G.post(javaUrl + '/road/list').then(rej => {
                console.log(rej)
                let listData = rej.data || []
                this.setData({
                    listArr: listData,
                    listArrSaveData:listData
                })
            })
          },
          selectHandler(e){
              const {item} = e.currentTarget.dataset
              console.log(item,'item')
              const eventChannel = this.getOpenerEventChannel()
              eventChannel.emit('acceptDataAddress',{item});
              wx.navigateBack()
          },
       
          getInput(e) {
            const value = e.detail.value
         
            const {listArrSaveData} = this.data
            if (value=='') {
              this.setData({
                  listArr:listArrSaveData
              })
              return
            }
            let result = listArrSaveData.filter(item=>item.name.includes(value))
              this.setData({
                  listArr:result
              })
           
        },
        },
        mounted() {
        
           this.getList()
        }
    })
})(wx.$)